progressbar: Enforce invariants
authorMatthias Clasen <mclasen@redhat.com>
Wed, 27 Apr 2016 00:44:07 +0000 (20:44 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 27 Apr 2016 00:44:07 +0000 (20:44 -0400)
When measuring gadgets, minimum must come out <= natural.
Make sure we don't fail this when measuring progressbar text.

https://bugzilla.gnome.org/show_bug.cgi?id=765644

gtk/gtkprogressbar.c

index a61fcb465ecd17d919c389563de9437dfbee8da9..9ba2c86d1f60141aef52a4dde3203ffd56e7fffe 100644 (file)
@@ -808,7 +808,7 @@ gtk_progress_bar_measure_text (GtkCssGadget   *gadget,
       else
         *minimum = logical_rect.width;
 
-      *natural = logical_rect.width;
+      *natural = MAX (*minimum, logical_rect.width);
     }
   else
     *minimum = *natural = logical_rect.height;